package ns

type Language byte

func (l Language) String() string {
	names := []string{
		"AmericanEnglish",
		"BritishEnglish",
		"Japanese",
		"French",
		"German",
		"LatinAmericanSpanish",
		"Spanish",
		"Italian",
		"Dutch",
		"CanadianFrench",
		"Portuguese",
		"Russian",
		"Korean",
		"TraditionalChinese",
		"SimplifiedChinese",
		"BrazilianPortuguese",
		"UnknownLanguage",
	}
	return names[l]
}

const (
	AmericanEnglish = Language(iota)
	BritishEnglish
	Japanese
	French
	German
	LatinAmericanSpanish
	Spanish
	Italian
	Dutch
	CanadianFrench
	Portuguese
	Russian
	Korean
	TraditionalChinese
	SimplifiedChinese
	BrazilianPortuguese
	UnknownLanguage
)

func ConvertNameToLanguage(name string) Language {
	switch name {
	case "AmericanEnglish":
		return AmericanEnglish
	case "BritishEnglish":
		return BritishEnglish
	case "Japanese":
		return Japanese
	case "French":
		return French
	case "German":
		return German
	case "LatinAmericanSpanish":
		return LatinAmericanSpanish
	case "Spanish":
		return Spanish
	case "Italian":
		return Italian
	case "Dutch":
		return Dutch
	case "CanadianFrench":
		return CanadianFrench
	case "Portuguese":
		return Portuguese
	case "Russian":
		return Russian
	case "Korean":
		return Korean
	case "TraditionalChinese", "Taiwanese":
		return TraditionalChinese
	case "SimplifiedChinese", "Chinese":
		return SimplifiedChinese
	case "BrazilianPortuguese":
		return BrazilianPortuguese
	}
	return UnknownLanguage
}
